var path = require("path");
var webpack = require("webpack");
const os = require("os");
///获取本机ip///
function getIPAdress() {
    var interfaces = os.networkInterfaces();
    for (var devName in interfaces) {
        var iface = interfaces[devName];
        for (var i = 0; i < iface.length; i++) {
            var alias = iface[i];
            if (
                alias.family === "IPv4" &&
                alias.address !== "127.0.0.1" &&
                !alias.internal
            ) {
                return alias.address;
            }
        }
    }
}
const myHost = getIPAdress();

module.exports = {
    module: {
        rules: [{
                test: /\.css$/,
                use: ["vue-style-loader", "css-loader"],
            },
            {
                test: /\.scss$/,
                use: ["vue-style-loader", "css-loader", "sass-loader"],
            },
            {
                test: /\.vue$/,
                loader: "vue-loader",
                options: {
                    loaders: {},
                    // other vue-loader options go here
                },
            },
            {
                test: /\.js$/,
                loader: "babel-loader",
                exclude: /node_modules/,
            },
            {
                test: /\.(png|jpg|gif|svg|eot|woff|woff2?|ttf)$/,
                loader: "file-loader",
                options: {
                    name: "[name].[ext]?[hash]",
                },
            },
        ],
    },
    resolve: {
        alias: {
            vue$: "vue/dist/vue.esm.js",
            "@": path.resolve("./src"),
            "@assets": path.resolve("./src/assets"),
            "@devass": path.resolve("./src/dev/assets"),
            "@utils": path.resolve("./src/dev/utils"),
            "@enu": path.resolve("./src/dev/enumerate"),
            "@comp": path.resolve("./src/dev/components"),
        },
        extensions: ["*", ".js", ".vue", ".json"],
    },
    devtool: "#source-map",
    performance: {
        hints: false,
    },
};